/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

.context-menu-container,
.context-menu-submenu-navigation,
.context-menu-tooltip {
  position: absolute;
  padding: var(--halfpad);
  background-color: var(--tooltip-background);
  color: var(--foreground);
  border: 1px solid var(--tooltip-border);
  display: flex;
  flex-direction: column;
  z-index: 2000;
  min-width: 180px;
  box-sizing: border-box;
}

.context-menu {
  overflow-y: auto;
  position: relative;
}

.context-menu-divider {
  border-top: 1px solid var(--tooltip-border);
  height: 0;
  margin: var(--halfpad);
}

.context-menu-item {
  padding: var(--halfpad);
  border-radius: var(--halfpad);
  cursor: pointer;
}
.context-menu-submenu {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.context-menu-item:hover,
.context-menu-item:focus {
  background-color: var(--hover-darken);
}

.context-menu-arrow {
  --arrow-height: calc(var(--pad) - 4px);
  --arrow-half-width: calc(var(--arrow-height) / 2);
  position: absolute;
}

.context-menu-arrow::after {
  content: ' ';
  position: absolute;
  width: var(--arrow-height);
  height: var(--arrow-height);
  background-color: var(--tooltip-background);
  border-right: 1px solid var(--tooltip-border);
  border-bottom: 1px solid var(--tooltip-border);
}

.context-menu-arrow-top::after {
  transform: rotate(225deg);
}
.context-menu-arrow-bottom::after {
  transform: rotate(45deg);
}

.context-menu-arrow-top {
  left: calc(50% - var(--arrow-half-width));
  top: calc(-1px - var(--arrow-half-width));
}
.context-menu-arrow-bottom {
  left: calc(50% - var(--arrow-half-width));
  bottom: calc(var(--arrow-half-width));
}

.context-menu-arrow-left {
  left: var(--pad);
}

.context-menu-arrow-right {
  right: var(--pad);
  left: unset;
}

.context-menu-disabled-option {
  cursor: not-allowed;
  opacity: 0.8;
}
